<template>
	<view class="find border" :style="{height:getEquipmentInfo}">
	  <view class="content">
		<template v-for="(item,index) in FindArray">
			<view class="contentItem" @click="GoToPage(item)" :key="index" v-if="userInfo.customerType!=item.customerType">
			  <view class="bg">
			    <image :src="item.img" class="image"></image>
			  </view>
			  <view class="name">{{item.name}}</view>
			</view>
		</template>
	  </view>
	</view>
</template>

<script>
	import { mapState} from 'vuex'
	import {skipPage} from '@/utils/common.js'
	export default {
		data() {
			return {
				FindArray:[
					{img:getApp().globalData.iconUrl+'/20220704/2d2a0ff844b249889600b446c8ca7086.png',name:'我的账单',customerType:'会员'},
					{img:getApp().globalData.iconUrl+'/20220704/fc1dcac70eb94a29a55700f4b9087122.png',name:'电费充值',customerType:'会员'},
					{name:'积分凭证',url:'/subpkg/partSwiperList/partSwiperList?title=积分凭证',img:'../../static/pageImage/integralList.png',customerType:''},
					{url:'/subpkg/partScrollList/partScrollList?title=会议预定',img:getApp().globalData.iconUrl+'/20220704/1f3771ca902c40ec8985f0bdcf393fa5.png',name:'会议预定',customerType:''},
					{img:getApp().globalData.iconUrl+'/20220704/6377cd2db7e041359bb1e8b1c5c4b1ec.png',name:'精彩活动',customerType:''},
					{url:'/subpkg/partScrollList/partScrollList?title=预约参观',img:getApp().globalData.iconUrl+'/20220704/7ec14a6326f84ff9b7842e45fb6a26e2.png',name:'预约参观',customerType:''},
					{img:getApp().globalData.iconUrl+'/20220805/6f73a4ed8f154086bce91328bd97e641.png',name:'停车缴费',customerType:''},
					{img:getApp().globalData.iconUrl+'/20220704/6bcdccf6dde742f4a5e949c355f87f3c.png',name:'物业报修',customerType:''},
					{url:'/subpkg/partScrollList/partScrollList?title=日常清洁',img:getApp().globalData.iconUrl+'/20220704/2a98c501f81f4599bcd141f8211ff35b.png',name:'日常清洁',customerType:''},
					{url:'/subpkg/partScrollList/partScrollList?title=日常巡检',img:getApp().globalData.iconUrl+'/20220704/5f2d0baa4953431ebf5cae24dbe09d26.png',name:'日常巡检',customerType:''},
					{img:getApp().globalData.iconUrl+'/20220704/56ca67cd5fe74cf29306db547fe816bb.png',name:'投诉建议',customerType:''},
					{img:getApp().globalData.iconUrl+'/20220704/8e21fb0fcb8d430da65ac1372daae21f.png',name:'问卷调查',customerType:''},
					{img:getApp().globalData.iconUrl+'/20220704/83ea68f9666b499ba54c71a40b57af6b.png',name:'房源信息',customerType:''},
					{url:'/pages/Business/Business',img:getApp().globalData.iconUrl+'/20220704/20315cc091634b0fb9610e0953128696.png',name:'商圈列表',customerType:''},
				    {url:'/subpkg/simplePage/simplePage?title=其他服务',img:getApp().globalData.iconUrl+'/20220704/39d10fdba3464e72a62028bb6c571a69.png',name:'联系客服',customerType:''},
				    {url:'/subpkg/simplePage/simplePage?title=其他服务',img:getApp().globalData.iconUrl+'/20220704/bb34af73d85b466aae6fd9f20953d698.png',name:'公共WIFI',customerType:''},
				      // {img:'https://yzy-yyds.oss-cn-guangzhou.aliyuncs.com/uploadPath/20220704/c6046b103dc94507b8aba5dab4f47834.png',name:'保洁服务'},
				      // {img:'https://yzy-yyds.oss-cn-guangzhou.aliyuncs.com/uploadPath/20220704/20315cc091634b0fb9610e0953128696.png',name:'去招聘'},
				      // {img:'https://yzy-yyds.oss-cn-guangzhou.aliyuncs.com/uploadPath/20220704/2f86bcc1e79043bd87298f3eabf89914.png',name:'搬家去'},
				]
			};
		},
		computed:{
			// 把m_user模块中的punchNumbers对象映射到当前组件中使用，代替data中的punchNumbers
			...mapState('m_user',['userInfo']),
			getEquipmentInfo(){
				let info=uni.$u.sys()
				return (info.windowHeight - 20) +'px'
			},
		},
		methods:{
			GoToPage(item){
				if(item.name=='商圈列表'){
					uni.switchTab({
						url:'/pages/Business/Business'
					})
				}else if(item.url){
					skipPage(item.url)
				}
			},
			setFindArray(){
				let ifTrue= this.FindArray.some(function(item){
					return item.name=='日常清洁'
				})
				if(this.userInfo.customerType!='运营'&&ifTrue){
					this.FindArray.splice(8,2)//后面加内容，这里可能也要变
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
.find{
  width:720rpx;
  background:#fff;
  box-shadow: 0px 1px 8px 1px rgba(167, 167, 167, 0.2 );
  box-sizing: border-box;
  margin:10px auto;
  padding-top:50px;
  .content{
    margin:0 auto;
    display:flex;
    flex-wrap: wrap;
	.contentItem{
	  width:140rpx;
	  height:145rpx;
	  display:flex;
	  flex-direction: column;
	  justify-content: space-between;
	  align-items: center;
	  margin-left:32rpx;
	  margin-bottom:60rpx;
	    .bg{
			width:100rpx;
			height:100rpx;
			display:flex;
			justify-content: center;
			align-items: center;
			.image{
			  height:100%;
			  width:100%;
			}
	    }
		.name{
		  font-size:21rpx;
		}
	}
  }
}
</style>
